﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.EquipmentManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.EquipmentManagement.EquipmentSpotItemVMs
{
    public partial class EquipmentSpotItemTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._EquipmentSpotItem._SpotType")]
        public ExcelPropety SpotType_Excel = ExcelPropety.CreateProperty<EquipmentSpotItem>(x => x.SpotType);
        [Display(Name = "_Model._EquipmentSpotItem._Content")]
        public ExcelPropety Content_Excel = ExcelPropety.CreateProperty<EquipmentSpotItem>(x => x.Content);
        [Display(Name = "_Model._EquipmentSpotItem._Template")]
        public ExcelPropety Template_Excel = ExcelPropety.CreateProperty<EquipmentSpotItem>(x => x.TemplateId);
        [Display(Name = "_Model._EquipmentSpotItem._Active")]
        public ExcelPropety Active_Excel = ExcelPropety.CreateProperty<EquipmentSpotItem>(x => x.Active);
        [Display(Name = "_Model._EquipmentSpotItem._CreateTime")]
        public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<EquipmentSpotItem>(x => x.CreateTime, true);
        [Display(Name = "_Model._EquipmentSpotItem._UpdateTime")]
        public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<EquipmentSpotItem>(x => x.UpdateTime, true);
        [Display(Name = "_Model._EquipmentSpotItem._CreateBy")]
        public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<EquipmentSpotItem>(x => x.CreateBy);
        [Display(Name = "_Model._EquipmentSpotItem._UpdateBy")]
        public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<EquipmentSpotItem>(x => x.UpdateBy);
        [Display(Name = "_Model._EquipmentSpotItem._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<EquipmentSpotItem>(x => x.IsValid);
        [Display(Name = "_Model._EquipmentSpotItem._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<EquipmentSpotItem>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            Template_Excel.DataType = ColumnDataType.ComboBox;
            Template_Excel.ListItems = DC.Set<EquipmentSpotTemplate>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class EquipmentSpotItemImportVM : BaseImportVM<EquipmentSpotItemTemplateVM, EquipmentSpotItem>
    {
            //import

    }

}